<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<%-- <%@ taglib prefix="sb" uri="/struts-bootstrap-tags" %> --%>
<!DOCTYPE html>
<html>
<head>
<%@ include file="/common/links.jsp"%>
<%--     <!-- Le HTML5 shim, for IE6-8 support of HTML elements -->
    <!--[if lt IE 9]>
    <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->

    <sb:head/> --%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript">
	$(document).ready(function() {
		$('#submit').click(function() {
			try{
			var subResult = $('#entityForm').ajaxSubmit(formOptions);
			return false;
			}catch(e){
				alert(e.message);
			}
		})
		$('#cancel').click(function() {
			parent.jQuery.colorbox.close();//这句话是需要的。
		})
		$("button").button();
		 $( "#demoEntity_dateField" ).datepicker(datePickerOptions);
		 jQuery("#entityForm").validationEngine({promptPosition : "centerRight"});
	});

</script>
</head>
<body>
	<fieldset>
		<legend>
			<c:if test="${editType==1}">
				<s:text name="demoEntityNew.title" />
			</c:if>
			<c:if test="${editType==2}">
				<s:text name="demoEntityEdit.title" />
			</c:if>
		</legend>
		<s:form id="entityForm" action="saveEntity" >
			<s:hidden name="gridId"/>
			<s:hidden name="editType"/>
			<s:textfield key="demoEntity.demoId" name="model.demoId" />
			<s:textfield key="demoEntity.intField" name="model.intField"  cssClass="validate[required,custom[integer]]"/>
			<s:textfield key="demoEntity.longField" name="model.longField" cssClass="validate[required,custom[integer]]"/>
			<s:textfield key="demoEntity.shortField" name="model.shortField" />
			<s:textfield key="demoEntity.byteField" name="model.byteField" />
			<s:checkbox key="demoEntity.booleanField" name="model.booleanField" />
			<s:textfield key="demoEntity.charField" name="model.charField" />
			<s:textfield key="demoEntity.floatField" name="model.floatField" cssClass="validate[required,custom[number]]">
			<s:param name="value"><s:number name="model.floatField" type="number" /></s:param>
			</s:textfield>
			<s:textfield id="demoEntity_doubleField" key="demoEntity.doubleField" name="model.doubleField" cssClass="validate[required,custom[number]]" required="true"/>
			<s:textfield key="demoEntity.intObjField" name="model.intObjField" cssClass="validate[required,custom[integer]]"/>
			<s:textfield key="demoEntity.longObjField" name="model.longObjField" cssClass="validate[required,custom[integer]]"/>
			<s:textfield key="demoEntity.shortObjField"
				name="model.shortObjField" />
			<s:textfield key="demoEntity.byteObjField" name="model.byteObjField" />
			<s:checkbox key="demoEntity.booleanObjField"
				name="model.booleanObjField" />
			<s:textfield key="demoEntity.charObjField" name="model.charObjField" />
			<s:textfield key="demoEntity.floatObjField"
				name="model.floatObjField" />
			<s:textfield key="demoEntity.doubleObjField"
				name="model.doubleObjField" />
			<s:textfield id="demoEntity_dateField" key="demoEntity.dateField" name="model.dateField" cssClass="validate[required,custom[date]]">
				<s:param name="value"><s:date name="model.dateField" format="%{getText('date.format')}"/></s:param>
			</s:textfield>
			<s:textfield key="demoEntity.stringField" name="model.stringField" />
			<s:textfield key="demoEntity.bigDecimalField"
				name="model.bigDecimalField" />
			<s:textfield key="demoEntity.timestampField"	name="model.timestampField" >
				<s:param name="value"><s:date name="model.timestampField" format="%{getText('timestamp.format')}"/></s:param>
			</s:textfield>
			
		</s:form>
			<button name="submit" type="button" id="submit" class="btn">
			<s:text name="button.save" />
		</button>
		<button name="cancel" type="button" id="cancel" class="btn">
			<s:text name="button.cancel" />
		</button>
	</fieldset>
</body>
</html>